package com.common.base.service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.common.base.entity.BaseEntity;
import com.common.base.exceptions.DaoException;
import com.common.tag.Page;

public interface BaseService<T extends BaseEntity> {

	public List<T> findByParams(Map<String, Object> params);

	public BigDecimal insert(T entity) throws DaoException;

	public int delete(T entity);

	public int update(T entity);

	public String getExcel(List<T> list, String excelTitle, String excelName) throws Exception;
	
	public T findBySid(Long sid);

	// public void insert(T entity) throws Exception;
	// public T findBySid(Long sid);
	// public void update(T entity);
	// public List<T> findPageByParams(int first, int max);
	// public List<T> findAll();
	// public Boolean isExsit(Long sid);
	// public List<T> findByParams(Map<String,Object> params);
	
	/**
	 * 分页查询
	 * @curPage 当前页码
	 * @pageSize 每页显示的记录条数
	 * */
	@SuppressWarnings("unchecked")
	public Page<T> findByPage(Map<String, Object> params, int curPage, int pageSize);

}
